SELECT pr.product_id, pr.work__position_num_id, pr.name, pr.production_control_type, pr.stock_balance__unit, pr.unit, pr.design_unit, pr.conversion_multiplier, pr.design_conversion_multip, pr.design_unit_2, pr.unit_2, pr.fixed, pr.reserved, pr.available, pr.record_id  FROM product pr  WHERE pr.work__position_num_id <> '' OR pr.reserved <> 0 OR pr.fixed <> 0 OR pr.available <> 0 OR pr.product_id IN (SELECT DISTINCT wme.raw_material_id FROM work_material_estimated wme INNER JOIN work_order wo ON wo.work__position_num_id = wme.work__position_num_id WHERE wo.state IN ('KU','AL')) AND pr.storable = true  ORDER BY pr.product_id  INTO :_lx_atExe1,:_lx_atExe2,:_lx_atExe3,:_lx_alExe1,:_lx_arExe1,:_lx_atExe4,:_lx_atExe5,:_lx_arExe2,:_lx_arExe3,:_lx_atExe6,:_lx_atExe7,:_lx_arExe4,:_lx_arExe5,:_lx_arExe6,:_lx_atExe8
 - result _lx_atExe1 size: 67, first value: 'AK_421436'
 - query name: new:plugin/nc-calc-server/query/storage-query/product-reserved.json. 	9.5.2022 	17:11:19 	_lx_ExecuteSqlNew 	(5. palvelin)

SELECT wme.work__position_num_id, wme.row_number, wme.work_phase_est_id, wme.raw_material_id, wme.quantity__unit, wme.unit, wme.quantity__unit_2, wme.unit_2, wme.record_id  FROM work_material_estimated wme  WHERE wme.work__position_num_id IN (SELECT DISTINCT wme.work__position_num_id FROM work_material_estimated wme INNER JOIN work_order wo ON wo.work__position_num_id = wme.work__position_num_id WHERE wo.state IN ('KU','AL'))  ORDER BY wme.work__position_num_id, wme.row_number, wme.raw_material_id  INTO :_lx_atExe1,:_lx_alExe1,:_lx_alExe2,:_lx_atExe2,:_lx_arExe1,:_lx_atExe3,:_lx_arExe2,:_lx_atExe4,:_lx_atExe5
 - result _lx_atExe1 size: 37, first value: '02056'
 - query name: new:form/nc/nc-storage/query/product_material-open.json. 	9.5.2022 	17:11:19 	_lx_ExecuteSqlNew 	(5. palvelin)

4D: SELECT wos.record_id FROM work_order_schedule wos LEFT OUTER JOIN work_order wo ON wo.production_lot = wos.production_lot  WHERE wo.state IN ('EK','KU','AL') INTO :_lx_atRecordId
 - original query: SELECT wos.production_lot, wos.work_phase, wos.work_load_group_id, wo.started_amount, wos.work_phase_state, wos.subtype, wos.produced_amount, wos.failed_amount, wos.remaining_amount, wos.can_be_manufactured, wos.manufacturing_state, wos.record_id FROM work_order_schedule wos  LEFT OUTER JOIN work_order wo ON wo.production_lot = wos.production_lot  WHERE wo.state IN ('EK','KU','AL')  ORDER BY wos.production_lot__work_ph  INTO :_lx_atExe1,:_lx_alExe1,:_lx_atExe2,:_lx_arExe1,:_lx_atExe3,:_lx_atExe4,:_lx_arExe2,:_lx_arExe3,:_lx_arExe4,:_lx_arExe5,:_lx_alExe2,:_lx_atExe5
 - result _lx_atExe1 size: 127, first value: '02056/01'
 - query name: new:plugin/nc-calc-server/query/storage-query/product_work-schedule-open.json. 	9.5.2022 	17:11:19 	_lx_ExecuteSqlNew 	(5. palvelin)

4D: SELECT wo.record_id FROM work_order wo WHERE wo.state IN ('EK','KU','AL') INTO :_lx_atRecordId
 - original query: SELECT wo.work__position_num_id, wo.production_lot, wo.state, wo.started_amount, wo.produced_amount, wo.failed_amount FROM work_order wo  WHERE wo.state IN ('EK','KU','AL')  ORDER BY wo.work__position_num_id  INTO :_lx_atExe1,:_lx_atExe2,:_lx_atExe3,:_lx_arExe1,:_lx_arExe2,:_lx_arExe3
 - result _lx_atExe1 size: 34, first value: '02056'
 - query name: new:plugin/nc-calc-server/query/storage-query/production_order-open.json. 	9.5.2022 	17:11:19 	_lx_ExecuteSqlNew 	(5. palvelin)

*** tcp close for sock 78, type 'nil', protocol 'HTTP', reason: 'POLLHUP', previous request length: 1 481 bytes ***. 	9.5.2022 	17:15:13 	lx 	(5. palvelin)

closing socket '78'. 	9.5.2022 	17:15:13 	lx 	(5. palvelin)

